<?php
session_start();

	// PROSES LOGIN DISINI
		include 'lib_func.php';
		
		$email = $_POST['email'];
		$pass  = md5($_POST['pass']);
		
		$koneksi = koneksi_db();
		$sql 	 = "select * from dtmember where email='$email' and katasandi='$pass'";
		$query 	 = mysql_query($sql,$koneksi);
		$cekAda  = mysql_num_rows($query);
		$f 		 = mysql_fetch_array($query);
		
		if ($cekAda == 0) {
			echo "<script language='javascript'>alert('Maaf Anda belum terdaftar menjadi member kami !');</script>";
			echo "<script language='javascript'>window.location = 'sign_up.php'</script>";
		}else{
						
			session_register("email","pass","id_member");
			$_SESSION['email'] = $email;
			$_SESSION['pass'] = $pass;
			$_SESSION['id_member'] = $f['id_member'];
			
			echo "<script language='javascript'>window.location = 'index.php'</script>";
		}
	// AKHIR DARI PROSES LOGIN
?>